package com.chenjian.annotation.dao;

import com.alibaba.druid.pool.DruidDataSource;

public class DataSources {

    private static DruidDataSource druidDataSource;

    static {
        // 从连接池拿连接并绑定到线程
        DruidDataSource dataSource = new DruidDataSource();
        dataSource.setDriverClassName("com.mysql.jdbc.Driver");
        dataSource.setUrl("jdbc:mysql://localhost:3306/bank");
        dataSource.setUsername("bank");
        dataSource.setPassword("QWEasd123");
        druidDataSource = dataSource;
    }

    private DataSources() {
    }

    public static DruidDataSource getDataSources() {

        return druidDataSource;

    }
}
